<?php

namespace app\backstage\validate;

use think\Validate;

class ToolValidate extends Validate
{
    protected $rule = [
        'id' => 'require|number|gt:0',
        'name' => 'require|max:20',
        'pay_mode' => 'require|in:1,2',
        'payment_type' => 'require|in:1,2,3',

        'mch_id' => 'require',
        'app_id' => 'require',
        'apiv3' => 'require',
        'mer_no' => 'require',
        'mer_account' => 'require',
        'public_key' => 'require',
        'private_key' => 'require',
        'referer' => 'require',
        'pay_style' => 'require|in:1,2',
        'value' => 'require|in:0,1',
        'baojing_minute' => 'require|number',
        'phone' => 'require|mobile'
    ];

    protected $message = [
    ];

    protected $scene = [
        'native_wechat' => ['name', 'mch_id', 'app_id', 'apiv3', 'referer'],
        'native_ali' => ['name', 'app_id', 'public_key', 'private_key'],
        'mihua_wechat' => ['name', 'mer_no', 'mer_account', 'public_key', 'private_key', 'referer'],
        'mihua_ali' => ['name', 'mer_no', 'mer_account', 'public_key', 'private_key', 'pay_style'],
        'fuyou_wechat' => ['name','mer_no','public_key','private_key'],
        'fuyou_ali' => ['name','mer_no','public_key','private_key'],
        'setDefaultPayment' => ['id','value'],
        'baojing' => ['id','baojing_minute'],
        'addAlarm' => ['phone','name'],
    ];
}